<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:r="http://richfaces.org/rich" xmlns:a="http://richfaces.org/a4j"
	xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:ad="http://agiledev.com.br/fieldset">

	<!-- lista de planejados -->
	<h:panelGrid columns="3" width="100%" columnClasses="colDs,colDs,colDs" style="clear: left;">

		<ad:fieldset id="fsPlanejado" legenda="#{messages.planejados}">

			<r:dropSupport acceptedTypes="taskAndamento" dropListener="#{dailyScrumMB.dropPlanejado}"
				reRender="fsAndamento,fsPlanejado,fsEstimativa" oncomplete="hl();">
			</r:dropSupport>

			<a:repeat id="rpItPl" value="#{dailyScrumMB.planejados}" var="item">

				<r:simpleTogglePanel id="stpPl" switchType="client" styleClass="dsItem">

					<f:facet name="header">
						<h:panelGroup>
							<h:outputText value="#{item.nome} - (" />

							<ui:include src="/pages/item/prioridade.xhtml">
								<ui:param name="valor" value="#{item.prioridade}" />
							</ui:include>

							<h:outputText value=") - #{item.estimativa}" />
						</h:panelGroup>
					</f:facet>

					<a:repeat id="rpTkPl" value="#{item.tarefas}" var="t">
						<s:div id="tkPl">
							<h:outputText value="#{t.descricao}" />

							<r:dragSupport dragIndicator="indicator" dragType="task" dragValue="#{t}">
								<r:dndParam name="label" value="#{t.descricao}" />
							</r:dragSupport>
						</s:div>
					</a:repeat>

				</r:simpleTogglePanel>

			</a:repeat>

		</ad:fieldset>

		<ad:fieldset id="fsAndamento" legenda="#{messages.emAndamento}">

			<r:dropSupport acceptedTypes="task" dropListener="#{dailyScrumMB.dropAndamento}"
				reRender="fsAndamento,fsPlanejado,fsFinalizado,fsEstimativa" oncomplete="hl();">
			</r:dropSupport>

			<a:repeat id="rpItAd" value="#{dailyScrumMB.andamentos}" var="item">

				<r:simpleTogglePanel id="stpAd" switchType="client" styleClass="dsItem">

					<f:facet name="header">
						<h:panelGroup>
							<h:outputText value="#{item.nome} - (" />

							<ui:include src="/pages/item/prioridade.xhtml">
								<ui:param name="valor" value="#{item.prioridade}" />
							</ui:include>

							<h:outputText value=") - #{item.estimativa}" />
						</h:panelGroup>
					</f:facet>

					<a:repeat id="rpTkAd" value="#{item.tarefas}" var="t">
						<s:div id="tkAd">
							<h:outputText value="#{t.descricao}" />

							<r:dragSupport dragIndicator="indicator" dragType="taskAndamento" dragValue="#{t}">
								<r:dndParam name="label" value="#{t.descricao}" />
							</r:dragSupport>
						</s:div>
					</a:repeat>

				</r:simpleTogglePanel>

			</a:repeat>

		</ad:fieldset>

		<ad:fieldset id="fsFinalizado" legenda="#{messages.finalizados}">

			<r:dropSupport acceptedTypes="taskAndamento" dropListener="#{dailyScrumMB.dropFinalizado}"
				reRender="fsAndamento,fsFinalizado,fsEstimativa" oncomplete="hl();">
			</r:dropSupport>

			<a:repeat id="rpItFi" value="#{dailyScrumMB.finalizados}" var="item">

				<r:simpleTogglePanel id="stpFi" switchType="client" styleClass="dsItem">

					<f:facet name="header">
						<h:panelGroup>
							<h:outputText value="#{item.nome} - (" />

							<ui:include src="/pages/item/prioridade.xhtml">
								<ui:param name="valor" value="#{item.prioridade}" />
							</ui:include>

							<h:outputText value=") - #{item.estimativa}" />
						</h:panelGroup>
					</f:facet>

					<a:repeat id="rpTkFi" value="#{item.tarefas}" var="t">
						<s:div id="tkFi">
							<h:outputText value="#{t.descricao}" />

							<r:dragSupport dragIndicator="indicator" dragType="task" dragValue="#{t}">
								<r:dndParam name="label" value="#{t.descricao}" />
							</r:dragSupport>
						</s:div>
					</a:repeat>

				</r:simpleTogglePanel>

			</a:repeat>
		</ad:fieldset>

	</h:panelGrid>
</ui:composition>